<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<link rel="stylesheet" type="text/css" href="template/default/content/css/style.css">
<script language="javascript" type="text/javascript" src="DatePicker/WdatePicker.js"></script>
<script language="javascript" type="text/javascript" src="template/default/js/jquery.min.js"></script>
<script src="template/default/tree/js/admincp.js?SES" type="text/javascript"></script>
<script charset="utf-8" src="eweb/kindeditor.js"></script>
<script type="text/javascript"> 
function show_help()
{
   mytop=(screen.availHeight-430)/2;
   myleft=(screen.availWidth-800)/2;
   window.open("admin.php?ac=view&fileurl=help&helpid=<?=$fileurl?>","","height=470,width=800,status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,top="+mytop+",left="+myleft+",resizable=yes");
}
function show_view()
{
   mytop=(screen.availHeight-430)/2;
   myleft=(screen.availWidth-800)/2;
   window.open("admin.php?ac=views&fileurl=work&id=<?=$blog['id']?>","","height=470,width=800,status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,top="+mytop+",left="+myleft+",resizable=yes");
}
fileoffice_show()
function fileoffice_show()
{
   jQuery.ajax({
      type: 'GET',
      url: 'admin.php?ac=file&do=office&fileurl=public&officeid=<?=$_GET['id']?>&officetype=3&'+new Date(),
      success: function(data){
		  if(data!=''){
			  $("#filenumberoffice").html(data);
		  }else{
			  $("#filenumberoffice").html('还没有文档!');
		  }
      }
   });
}
</script>
<title>Office 515158 2011 OA办公系统</title>
 
</head>
<body>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="0" class="small">
  <tr>
    <td class="Big"><img src="template/default/content/images/notify_new.gif" align="absmiddle"><span class="big3"> 流程办理</span>&nbsp;&nbsp;&nbsp;&nbsp;
	<span style="font-size:12px;"><a href="#" onClick="show_help()" style="font-size:12px;">使用帮助文档？</a>&nbsp;|&nbsp;
	<a href="http://bbs.515158.com/" target="_blank" style="font-size:12px;">使用遇到问题？</a>&nbsp;|&nbsp;
	<a href="admin.php?ac=index&fileurl=<?=$fileurl?>" style="font-size:12px;">返回列表页</a><img src="template/default/content/images/f_ico.png" align="absmiddle">&nbsp;|&nbsp;
	<a href="#" onClick="show_view()" style="font-size:12px;color:red;">查看流程信息及记录</a></span>
    </td>
  </tr>
</table>
<script Language="JavaScript"> 
function CheckForm()
{
	<? if($tpl['tmpytpe']=='2'){?>
   if(document.save.userkey.value=="")
   { alert("审批人员不能为空！");
     document.save.userkey.focus();
     return (false);
   }
   <? }?>
   if(document.save.lnstructions.value=="")
   { alert("结果批示不能为空！");
     document.save.lnstructions.focus();
     return (false);
   }
   
   return true;
}
function sendForm()
{
   if(CheckForm())
      document.save.submit();
}
</script>
<form name="save" method="post" action="?ac=views_key&do=save&fileurl=work">
<input type="hidden" name="workclassid" value="<?=$blog["id"]?>" />
	 <input type="hidden" name="bid" value="<?=$_GET["bid"]?>" />
<table class="TableBlock" border="0" width="90%" align="center">
 <tr>
   <td height="60" colspan="2" align="center" nowrap class="TableContent"><span class="big3"> <?=$blog['title']?></span></td>
   </tr>
<?php
//获取当前流程
if($tpl['tmpytpe']=='2'){
	if($pflow["type"]!='2'){
		$flow = $db->fetch_one_array("SELECT * FROM ".DB_TABLEPRE."workclass_flow WHERE template_id='".$blog["worktemplate"]."' and type_id='".$blog["workclasstype"]."' and number>'".$pflow["number"]."' and unionid='".union_id."' ORDER BY id asc LIMIT 1");
		echo '<tr><td nowrap class="TableContent" width="15%"> ';
        echo '设置审批人员：';
		get_user_add_help();
		echo'</td><td class="TableData">';
		if($flow['flowtype']=='2'){
			get_oa_member_public(1,"userkey",$flow["workuser"],"",120,20);
		}else{
			get_oa_member_public(1,"userkey",$flow["workuser"],"+选择审批人员",120,20);
		}
	    echo '<br>';
	    get_sms_info_phone_box("审批人员","shownamemaster");
	    echo '<input type="hidden" name="flowid" value="'.$flow["id"].'" />';
	    echo '<br>设置下一步流程审批人员,流程步骤['.$flow["title"].']</td></tr>';	
	}else{
		echo '<input type="hidden" name="userkey" value="1" />';
		echo '<input type="hidden" name="type" value="'.$pflow['type'].'" />';
		echo '<input type="hidden" name="getflowid" value="1" />';
	}
//自由流程	
}else{
		echo '<tr><td nowrap class="TableContent" width="15%"> ';
        echo '设置审批人员：';
		get_user_add_help();
		echo'</td><td class="TableData">';
		get_oa_member_public(1,"userkey",$flow["workuser"],"+选择审批人员",120,20);
	    echo '<br>';
	    get_sms_info_phone_box("审批人员","shownamemaster");
	    echo '<input type="hidden" name="flowid" value="'.$flow["id"].'" />';
	    echo '<br>设置下一步流程审批人员,该流程步骤[自由流程]</td></tr>';	
}

?>	
 <tr>
      <td nowrap class="TableContent" width="15%">结果批示：</td>
      <td class="TableData">
	  
	    <textarea name="lnstructions" rows="8" class="BigInput" id="lnstructions" style="width: 500px;"></textarea>
	  
	  
	  </td>
    </tr>
 
<?php if($tpl['tmpytpe']=='1'){?>
 <tr>
      <td nowrap class="TableContent" width="15%">状态：</td>
      <td class="TableData"><input name="type" type="radio" value="1" checked="checked" />
        继续下一步流程
	  <input type="radio" name="type" value="2" />流程结束</td>
    </tr>
<?php }?>
 <?php if($_CONFIG->config_data('configoffice')=='1'){?>
  
	 <tr>
      <td nowrap class="TableHeader" colspan="2"><b>&nbsp;正文设置</b></td>
    </tr>  
	<tr>
      <td nowrap class="TableContent" width="15%">文档：</td>
      <td class="TableData" id="filenumberoffice">
	 </td>
    </tr>
	<input type="hidden" name="fileofficeid" class="BigInput"  onpropertychange="fileoffice_show();" />
	 <? }?>
 
 
 <tr align="center" class="TableControl">
      <td colspan="2" nowrap height="35">
		<input type="button" name="Submit" value="提交流程办理" class="BigButton" onclick="sendForm();">      </td>
    </tr>
  </table>
</form>


 
</body>
</html>
